﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VideoClubGorbea.Common.Interfaces;
using VideoClubGorbea.Model;
using VideoClubGorbea.ServicesClient.Interfaces;
using VideoClubGorbea.ServicesClient.Proxy;

namespace VideoClubGorbea.ServicesClient
{
    public class MovieServicesProxy : IMovieServicesProxy
    {
        internal bool isDistributed = false;

        internal IMovieServicesClient client;

        public MovieServicesProxy(IMovieServicesClient movieServices)
        {
            client = movieServices; 
        }

        public List<Movie> GetLatestMovies(int? pageSize)
        {
          return  client.GetLatestMovies(pageSize);
        }

        public Task<List<Movie>> GetLatestMoviesAsync(int? pageSize)
        {
           return client.GetLatestMoviesAsync(pageSize);
        }

        public Movie GetMovieById(int? id)
        {
            return client.GetMovieById(id);
        }

        public Task<Movie> GetMovieByIdAsync(int? id)
        {
            return client.GetMovieByIdAsync(id);
        }

        public List<Movie> SearchMovies(string title)
        {
            return client.SearchMovies(title);
        }

        public Task<List<Movie>> SearchMoviesAsync(string title)
        {
            return client.SearchMoviesAsync(title);
        }
    }
}
